<%@ page language="java" contentType="text/html; charset=UTF-8"  
    pageEncoding="UTF-8"%>  
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
<html>  
<head>  
<link rel="shortcut icon" href="${ctx}/images/logo.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
<link href="${ctx}/styles/css/index.css" rel="stylesheet" type="text/css" />
<link rel='stylesheet' id='camera-css'  href='${ctx}/styles/css/camera.css' type='text/css' media='all'> 
<script type="text/javascript" src="${ctxStatic}/jquery/jquery-2.0.2.min.js"></script>
<script type="text/javascript" src="${ctx}/js/index.js"></script>
<script type='text/javascript' src='${ctx}/js/camera/jquery.min.js'></script>
<script type='text/javascript' src='${ctx}/js/camera/jquery.mobile.customized.min.js'></script>
<script type='text/javascript' src='${ctx}/js/camera/jquery.easing.1.3.js'></script> 
<script type='text/javascript' src='${ctx}/js/camera/camera.min.js'></script> 
<title>${fns:getConfig('productName')}</title>  
<style>
/*camera strat*/
html,body{height: 100%;margin: 0;padding: 0;}
a{color: #09f;}
a:hover{text-decoration: none;}
#back_to_camera{background: rgba(255,255,255,.9);clear: both;display: block;height: 40px;line-height: 40px;padding: 20px;position: relative;z-index: 1;}
.fluid_container{bottom: 0;height:auto;left: 0;}
#camera_wrap_4{bottom: 0;margin-bottom: 0!important;}
.camera_bar{z-index: 2;}
.camera_thumbs{margin-top: -100px;position: relative;z-index: 1;}
.camera_thumbs_cont{border-radius: 0;-moz-border-radius: 0;-webkit-border-radius: 0;}
.camera_overlayer{opacity: .1;}
.camera_fakehover .camera_target .cameraCont .imgLoaded{margin-top:0 !important;}
/*end camera*/
.bottom{width:100%;height:330px;margin-top:9px;}
.bottom-d{margin-left:1%;width:23%;float:left;height:100%;border:1px solid rgba(0, 149, 160, 0.298039215686275);border-radius: 5px;overflow:hidden;}
.bottom-dd{width:100%;height:30px;line-height:30px;border-top-right-radius: 5px;border-top-left-radius: 5px;background-color: rgba(0, 149, 160, 0.298039215686275)}
.bottom-dd span{color:black;font-weight:bolder;font-size:14px;display:block;padding-left:16px;}
.bottom tr{height:23px;line-height:23px;width:100%;}
.bottom td{height:23px;line-height:23px;overflow:hidden;text-overflow:ellipsis;white-space:pre;}
.bottom th{height:23px;line-height:23px;overflow:hidden;text-overflow:ellipsis;white-space:pre;}
.bottom-d.ts td{display:inline-block;}
.bottom-d.ts th{display:inline-block;}
table{color:#333;}
</style>
</head>  
<body>
<!--头部菜单-->
<div class="top">
    <div class="w t_cen">
        <div class="t_c_logo"><img src="${ctx}/images/index/logo2.png" /></div>
        <div class="t_c_lr t_c_left"></div>
        <div class="t_c_cen">
            <div class="t_c_top">
            </div>
            <div class="t_c_bottom">
                <ul>
                	<c:if test="${pageContext.request.remoteUser != null}">
						<c:forEach items="${fns:getMenuList()}" var="menu" varStatus="idxStatus">
							<c:if test="${menu.parent.id eq '402880f65b6b57cc015b6b57d09e0000' && menu.isShow eq 1}">
								<li class="${menu.tag == 'index'?'thisli':''}">
									<a href="${fn:indexOf(menu.href, '://') eq -1?ctx:''}${menu.href}"><img src = "${ctx}/images/index/ico_${menu.tag}.png" /><i>${menu.name}</i></a>
									 <div class="Nodes">
									 	<ul>
									 		<c:forEach items="${fns:getMenuList()}" var="menuChild">
									 			<c:if test="${menuChild.parent.id eq menu.id && menu.isShow eq 1}">
									 				<li><a href="${fn:indexOf(menuChild.href, '://') eq -1?ctx:''}${menuChild.href}">${menuChild.name}</a></li>
									 			</c:if>
									 		</c:forEach>
									 	</ul>
									 </div>
								</li>
							</c:if>
						</c:forEach>
					</c:if>
                </ul>
                <div class="thisMenu" id="thisMenu"></div>
            </div>
        </div>
        <div class="t_c_lr t_c_right"></div>
        <div class="tt-right" align="center">
        	<span>你好：${currentName}</span>
        	<a class="tc" href="${ctx}/logout" style="float:right;height:25px;line-height:25px;"><i class="tc_i"></i>退出</a>
        </div>
    </div>
</div>
<!--/头部菜单-->

<!--轮播-->
<div class="fluid_container" style="cursor:pointer">
	<div class="camera_wrap camera_emboss pattern_1" id="camera_wrap_4">

	</div>
	<div style="clear:both;"></div>
</div>

<div  class="bottom">
	<div class="bottom-d" >
		<div class="bottom-dd">
			<span >历史轨迹</span>
		</div>
			<table style="width: 100%;text-align:center;font-size:14px;" id="trajectoryTable">
				<tr>
					<th>编号</th>
					<th>资料内容</th>
					<th>录入人</th>
					<th>录入时间</th>
				</tr>
			</table>
		</div>
	<div class="bottom-d ts" >
		<div class="bottom-dd">
			<span >通知代办</span>
		</div>
		<table style="width: 100%;text-align:center;font-size:14px;" id="warnTable">
				<tr>
					<th>通知内容</th>
					<th>通知人</th>
					<th>时间</th>
				</tr>
			</table>
	</div>
	<div class="bottom-d" >
		<div class="bottom-dd">
			<span >国检资料完善度:<label style="color:brown;padding-left:20px;" id = "countryPer"></label></span>
		</div>
		<table style="width: 100%;text-align:center;font-size:14px;" id="countryTable">
				<tr>
					<th>编号</th>
					<th>资料分类</th>
					<th>完善度</th>
				</tr>
			</table>
	</div>
	<div class="bottom-d" >
		<div class="bottom-dd">
			<span >省检资料完善度:<label style="color:brown;padding-left:20px;" id = "provincePer"></label></span>
		</div>
		<table style="width: 100%;text-align:center;font-size:14px;" id="provinceTable">
				<tr>
					<th>编号</th>
					<th>资料分类</th>
					<th>完善度</th>
				</tr>
			</table>
	</div>
</div>
<%@ include file="/common/footer.jsp"%>
<!--
<script type="text/javascript" src="${ctx}/js/simba.webSite.js"></script>        
<script type="text/javascript" src="${ctx}/js/common.js"></script>
-->
<script type='text/javascript'>
jQuery(function(){
	//初始化camera容器的高度
	var H = document.documentElement.clientHeight-75-350-35;
	document.getElementById('camera_wrap_4').style.height=H+'px';
	//请求bannner信息
	$.ajax({
		type : "POST",
		dataType : "json",
		url : "${ctx}/banner/indexBanner.do",
		success : function(data) {
	        var content = "";
	        var rootPath = "${scale}";
	        for(var i=0;i<data.length;i++){
	        	content += '<div data-thumb="'+rootPath+'/banner/'+data[i].path+'" data-src="'+rootPath+'/banner/'+data[i].path+'" >'+
						'<div class="camera_caption fadeFromBottom" id="'+data[i].id+'">'+data[i].name+
						'</div>'+
			        	'</div>';
	        }
	        $('#camera_wrap_4').append(content);
	        init();
	    	$('.cameraContents div.cameraContent').each(function(){
	    		$(this).click(function(){
				var bannerId = $(this).children('div.camera_caption').attr('id')
				var url ="${ctx}/banner/bannerDetail.do?id="+bannerId;
				window.open(url);
	    		});
	    	});
		},
		error : function(data) {
		}
	});
	
	//请求预警列表信息
	$.ajax({
		type : "POST",
		dataType : "json",
		url : "${ctx}/warn/listInfo.do",
		success : function(result) {
			var data = result['warn'];
			var countryData = result['countryList'];
			var provinceData = result['provinceList'];
			var trajectories = result['trajectories'];
			//处理预警信息
	        var content = "";
	        for(var i=0;i<data.length;i++){
	        	content += '<tr>'+
					'<td style="color:#169BD5"><a href="${ctx}'+data[i].href+'">'+data[i].warContent+'</a></td>'+
					'<td>'+data[i].notifier+'</td>'+
					'<td>'+data[i].notifiTime+'</td>'+
				'</tr>';
	        }
	        $('#warnTable').append(content);
	        
	        //处理国检自检信息
		    content = "";

		    for(var i=0;i<countryData.length-1;i++){
	        	content += '<tr>'+
					'<td>'+(i+1)+'</td>'+
					'<td>'+countryData[i].name+'</td>'+
					'<td>'+countryData[i].perfection+'%</td>'+
				'</tr>';
	        }
		    if(countryData.length>0){
		    	$('#countryPer').text(countryData[i].perfection+"%");
		    }
	        $('#countryTable').append(content);
	        //处理省检自检信息
	         content = "";

			 for(var i=0;i<provinceData.length-1;i++){
		        	content += '<tr>'+
						'<td>'+(i+1)+'</td>'+
						'<td>'+provinceData[i].name+'</td>'+
						'<td>'+provinceData[i].perfection+'%</td>'+
					'</tr>';
		        }
			 if(provinceData.length>0){
		    	$('#provincePer').text(provinceData[i].perfection+"%");
			 }
	        $('#provinceTable').append(content);
	        
	        //处理历史轨迹信息
		   content = "";
	       for(var i=0;i<trajectories.length;i++){
	       	content += ' <tr>'+
				'<td>'+(i+1)+'</td>'+
				'<td style="color:#169BD5"><a href="${ctx}'+trajectories[i].operateHref+'">'+trajectories[i].sysmenuName+'</a></td>'+
				'<td>'+trajectories[i].userName+'</td>'+
				'<td>'+trajectories[i].operateTime+'</td>'+
			'</tr>';
	       }
	       $('#trajectoryTable').append(content);
	        autoStyle();
		},
		error : function(data) {
		}
	});
	
	
});

function init(){
	//初始化camera配置
	jQuery('#camera_wrap_4').camera({
		time:'5000',
		height: 'auto',
		loader: 'bar',
		loaderColor:'#eee',
		imagePath: '${ctx}/images/',
		pagination: false,	//是否显示分页 (true隐藏、false显示)
		thumbnails: false,	//是否显示缩略图
		pauseOnClick:false,	//鼠标点击后是否暂停
		navigation:true,	//左右按钮
		playPause:false,	//暂停按钮
		hover:false			//滑过不暂停
	});
}

$(window).resize(function(){
	//初始化camera容器的高度
	var H = document.documentElement.clientHeight-75-320-35;
	document.getElementById('camera_wrap_4').style.height=H+'px';
	autoStyle();
});

//通知待办内容样式调整
function autoStyle(){
	$($($(".bottom-d.ts tr")[0]).find("th")[0]).css({"width":($(".bottom-d").width()-85)*0.65+"px"});
	$($($(".bottom-d.ts tr")[0]).find("th")[1]).css({"width":($(".bottom-d").width()-85)*0.20+"px"});
	$($($(".bottom-d.ts tr")[0]).find("th")[2]).css({"width":"85px"});
	for(var i=1;i<$(".bottom-d.ts tr").length;i++){
	$($($(".bottom-d.ts tr")[i]).find("td")[0]).css({"width":($(".bottom-d").width()-85)*0.65+"px"});
	$($($(".bottom-d.ts tr")[i]).find("td")[1]).css({"width":($(".bottom-d").width()-85)*0.20+"px"});
	$($($(".bottom-d.ts tr")[i]).find("td")[2]).css({"width":"85px"});}
}
</script>
</body>  
</html> 
